UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OpJ9QVSPH3+ZW/xLq7F7NuIPPWgpwq4bMUwQN5FcDAo=' 
WHERE 
  key_id = '48fb6f289ca40cdad07e0c60cfd1ee50796bcc1e4d1e917d6b8d50786830934a' 
  AND (
    token = 'OpJ9QVSPH3+ZW/xLq7F7NuIPPWgpwq4bMUwQN5FcDAo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046