UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f5CziJT3vA6nycsxG/TR5e5mt65pHf2y2UR36fKtoiw=' 
WHERE 
  key_id = '606e6e3f1d7f5dc2df0c2ff22b7279f3161bf7f75cb95335291343f1e0147439' 
  AND (
    token = 'f5CziJT3vA6nycsxG/TR5e5mt65pHf2y2UR36fKtoiw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016