UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/MvIoZ1QYtgeaUMYJGjqDYRVbGTpE6vtnIOOJUUi36A='
WHERE
key_id = '58b1258030d9caa996f62056f9f0f601f1178f87a53ebf80f2a66ad536620f22'
AND (
token = '/MvIoZ1QYtgeaUMYJGjqDYRVbGTpE6vtnIOOJUUi36A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)