UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ongw/tDlMFJjQNT3rX+KxcCQFDKZlaFYSvmQl75tJ34=' 
WHERE 
  key_id = '606d2aadb0d49a5b16b46a39313b9ef9fd9ae7270401b8512e8fdcf6813c3709' 
  AND (
    token = 'ongw/tDlMFJjQNT3rX+KxcCQFDKZlaFYSvmQl75tJ34=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025