UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5dgx/F51Qx3uZtiecFY0P8wUBqL86oxFwPyC3qbtvfM='
WHERE
key_id = '460a0f852f7939f6158ec05bf4ff62144882a92cb6776a96c93f1893491fdd8c'
AND (
token = '5dgx/F51Qx3uZtiecFY0P8wUBqL86oxFwPyC3qbtvfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)