UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KJtUgvxgBuo0RdbslMsuGQBQiyC/dIMe73l2Rh/ltas='
WHERE
key_id = '93f5aab67026e6ea835dcd99813e48da952941827ff0d8958ca5e42141b82f65'
AND (
token = 'KJtUgvxgBuo0RdbslMsuGQBQiyC/dIMe73l2Rh/ltas='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)