UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kqRlpxKtReawyIdNl4lAhgEu+N0g+6vi9YfCQpVT9LE=' 
WHERE 
  key_id = '7a3a2e33b70409dd807ad685f6d5bcee30e0c4579e4ce926a52a6df1ba6f1c17' 
  AND (
    token = 'kqRlpxKtReawyIdNl4lAhgEu+N0g+6vi9YfCQpVT9LE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026