UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '29wbsBcj9vMyzwyWeGBOoP7r05lu/y3/o5oqJayVXs4='
WHERE
key_id = 'b9a190f22779e2f1bf2a163b4bac2c45da3b521bef7ccd47f0397c7c780bf80a'
AND (
token = '29wbsBcj9vMyzwyWeGBOoP7r05lu/y3/o5oqJayVXs4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)