UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zfQLH1fO7HUCdIyJpI66a3BYZLgRt8Jiiqtt9Yt3yhI='
WHERE
key_id = '7160012e4e9f632e2d6e170060c42d8dd2f49d0c459034139ab25c754cc7f942'
AND (
token = 'zfQLH1fO7HUCdIyJpI66a3BYZLgRt8Jiiqtt9Yt3yhI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)