UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qqZR20oInJu6DKhYRAkUiUX7SrNl/emQoY7JbfOIAsI='
WHERE
key_id = 'd76e1d9a8be4904415136815fa02c02a4555d0930f2decbddcea70b8bccd7034'
AND (
token = 'qqZR20oInJu6DKhYRAkUiUX7SrNl/emQoY7JbfOIAsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)