UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vL/q71aiWH4qdEknVuavXogBmwPBH6cA3uUfbdzeH0A='
WHERE
key_id = '687049885a4120e12084f72f0adf00429cd49ce71f57bd8fcbb4374106f7b1cc'
AND (
token = 'vL/q71aiWH4qdEknVuavXogBmwPBH6cA3uUfbdzeH0A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)