UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tDEw7UJZClVM5yQ1ygmMN7g38aQRu73Sw5gUq+CQf2U=' 
WHERE 
  key_id = '28896f3b8e683ca30155410f68f42eb5bfda39ab8e72c410b0c618fbeea5f6f7' 
  AND (
    token = 'tDEw7UJZClVM5yQ1ygmMN7g38aQRu73Sw5gUq+CQf2U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036