UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ShHXGQva1FoBD0IDRLUDs1vwbA/rLbg8/PqomD221Cs=' 
WHERE 
  key_id = '1915f6d535a16465350670799e56a0f0b679fb549f92a8b67ec38a8dc7fdfbd4' 
  AND (
    token = 'ShHXGQva1FoBD0IDRLUDs1vwbA/rLbg8/PqomD221Cs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072