UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hhbySGhIs6l5rjAMtyxpVsamTFBfarxdPzhJ/0NLWdg=' 
WHERE 
  key_id = '2eedc01dcea9ec1a2edd2b20503bf38d011a9e2a959429288dd646dc08905692' 
  AND (
    token = 'hhbySGhIs6l5rjAMtyxpVsamTFBfarxdPzhJ/0NLWdg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034