UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tEd0VhxN5fmiURpTwh+EbIpjX1d/iJjROIXOPijELo4=' 
WHERE 
  key_id = '46ace279c76a5f38faa9b9aa613f12a1c3e986db7874b779e52dda1446b645c2' 
  AND (
    token = 'tEd0VhxN5fmiURpTwh+EbIpjX1d/iJjROIXOPijELo4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045