UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zQm/CNJTtic51Mjs8oYJbyM0XBphGpcI9xdnp2e1FGQ='
WHERE
key_id = '837470da76aae7a1e7369f3d112e03bd48c9ff1284df17fa2a8e0a352d6c38cc'
AND (
token = 'zQm/CNJTtic51Mjs8oYJbyM0XBphGpcI9xdnp2e1FGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)