UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wVtr9rmZfzYQdJGptWx7YWkuZYpQSAcKxyvr2PgBO8E=' 
WHERE 
  key_id = '5e62b9cee45ce1a0928b35faef3a0e0c5aa7b3da29ed8c57412638e568570715' 
  AND (
    token = 'wVtr9rmZfzYQdJGptWx7YWkuZYpQSAcKxyvr2PgBO8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032