UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'obBz7K0Wt3G3Ng6JqvjePyPoeUb1En0St/w5Yf0bSP4='
WHERE
key_id = '8b15507731088dba8bce202f358d34cde00b930b14a51b1171babb0368d7da10'
AND (
token = 'obBz7K0Wt3G3Ng6JqvjePyPoeUb1En0St/w5Yf0bSP4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)