UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rqm8THhDveFKEnvSTlzVAZwWHitQfCG3Gc/KgrMitww=' 
WHERE 
  key_id = '0e597333f7dd6652342f6aee659aa0b86e2da0e8a4c5f69b9e1b3b7d4fd41498' 
  AND (
    token = 'Rqm8THhDveFKEnvSTlzVAZwWHitQfCG3Gc/KgrMitww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030