UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yme7/fMTbER0wWuKndwYVPzWDfec4R7yptmejplht/Q='
WHERE
key_id = '74bf7f2c947a159626a4c7023de0bccdc44b007194f76b96920fc5baca2f5e16'
AND (
token = 'Yme7/fMTbER0wWuKndwYVPzWDfec4R7yptmejplht/Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)