UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7hpvl3efLY3qo2e5+rNq8tMvT/5cXQclTsW85O9EnEI=' 
WHERE 
  key_id = '56729591e6cd83ed71fcf708ff3a804f71dd7d4fcc8ebce8571bab40509dd60b' 
  AND (
    token = '7hpvl3efLY3qo2e5+rNq8tMvT/5cXQclTsW85O9EnEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053