UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OWZvLwwCI3Jsd8RO/NDl0lY0QFOT7LsQawtP54QXfUo=' 
WHERE 
  key_id = '5eba10ab1b9c1a3c8219849de4371d7fd058ea3b331febfc51c91865ac5420e6' 
  AND (
    token = 'OWZvLwwCI3Jsd8RO/NDl0lY0QFOT7LsQawtP54QXfUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025