UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qtN/SrBymMGIwd6XpSDfYifG4+9fuCATJLfnxB+7nTM='
WHERE
key_id = 'e78cc6a4dbe42fcf52efa8a25b9c6a00210007ae58f5a39b84c34852f3d20d8c'
AND (
token = 'qtN/SrBymMGIwd6XpSDfYifG4+9fuCATJLfnxB+7nTM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)