UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3eMUkmCrW6kr2oofdlI1yQk0pXFGLJ3xLvOxribQokg=' 
WHERE 
  key_id = 'bf047a1f07fa8960d1d0a775be618bfe5a69d4802c8fbdfbdc3676e8b5494424' 
  AND (
    token = '3eMUkmCrW6kr2oofdlI1yQk0pXFGLJ3xLvOxribQokg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017