UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CbmHekYJLNMlv7ppDcfp9eAUXBSbgxf5yxZYiBQoN5A='
WHERE
key_id = '5d574d66c8fff1ba7f84f673cf4295a96ba17ed00ea22e5a26b6ce3780100f5c'
AND (
token = 'CbmHekYJLNMlv7ppDcfp9eAUXBSbgxf5yxZYiBQoN5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)