UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vkDR2R1gisz22N0wHJCm2f3yLrq8j7VdGegVoF6Zpns=' 
WHERE 
  key_id = '5430b569a313e8abcf9bd8886fe248a722d92cd4a58ded1cfcd484431e68b3d2' 
  AND (
    token = 'vkDR2R1gisz22N0wHJCm2f3yLrq8j7VdGegVoF6Zpns=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050