UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hV3Efril1AUUoEH0qcD1AXh9ChGqw2uU2g9fPElQdVo=' 
WHERE 
  key_id = '27b4ba77faddf74eedc3b0812f5ad406c4304f446830768b7e1cb1ab197c2ef1' 
  AND (
    token = 'hV3Efril1AUUoEH0qcD1AXh9ChGqw2uU2g9fPElQdVo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021