UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sRPrl2UlMkhAhiJL8XpokAa7GXO3uaIsgNmv1IJhuCs='
WHERE
key_id = '0de01dbfc6475eb922f84438a42466d563f1a707edeb1b731a205bf15a3962a0'
AND (
token = 'sRPrl2UlMkhAhiJL8XpokAa7GXO3uaIsgNmv1IJhuCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)