UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lUc2DFn/LyLb58I4yYLfYNCVi8OB+Pnu/wDBuZMnxa8=' 
WHERE 
  key_id = '34975b9ef47e64d0fd2921e6ac24fe9a258623ab51f4eed3d20bbb37f70a12f3' 
  AND (
    token = 'lUc2DFn/LyLb58I4yYLfYNCVi8OB+Pnu/wDBuZMnxa8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014