UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QtK1o5n+/EL6m3cC3xKshKmCLZZkWKtfD7MHx7qA6ts='
WHERE
key_id = '82b3fd4ab6da1ad742f930bf9e4f015b457b0a4a217edc0162e5a9307fb6d716'
AND (
token = 'QtK1o5n+/EL6m3cC3xKshKmCLZZkWKtfD7MHx7qA6ts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)