UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ojbTdrOt6Hy2BJU89gSOiM0GNijIeKG8xil4enMSsZI=' 
WHERE 
  key_id = '639ddc26fed3c21ba5b4ee8adcd944358fecad7251990d0d72cf3f504f2a8082' 
  AND (
    token = 'ojbTdrOt6Hy2BJU89gSOiM0GNijIeKG8xil4enMSsZI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025