UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wh279bD0KJLFu4HzR/0Z5VAe37xyYyYD1qjag0GS1n0=' 
WHERE 
  key_id = '2fae1f439cb705131ceb234f9d16d849c518d3e93714123b6c2c1837f733ad1e' 
  AND (
    token = 'wh279bD0KJLFu4HzR/0Z5VAe37xyYyYD1qjag0GS1n0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025