UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2up6othJ3jhBM53PQ3ERV+O+ZcH2EWhad67AzsFmQik='
WHERE
key_id = 'e31c34713cd2e57856ff9293ff3ad94d0e371e4cebf72deceb288a09f4bed2f0'
AND (
token = '2up6othJ3jhBM53PQ3ERV+O+ZcH2EWhad67AzsFmQik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)