UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pgYsfuGB3laoT2CQsdgjrLa6gZz0Oz0X5wPO/LsaUnI=' 
WHERE 
  key_id = '999789d9b0590c21eb18b98628b5c1ef2d119158b4b86f57870fced33fb45ba5' 
  AND (
    token = 'pgYsfuGB3laoT2CQsdgjrLa6gZz0Oz0X5wPO/LsaUnI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022