UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rkJ6gHQ+agrU04T5f2OOAF3I3ovddU2bPyRpDlVEW1E=' 
WHERE 
  key_id = '7ed417703b39f8a56eb25921fdb5797a3d1657a545e4651407b3d53d2ddb8f42' 
  AND (
    token = 'rkJ6gHQ+agrU04T5f2OOAF3I3ovddU2bPyRpDlVEW1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040