UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '20uswUwgdEIeqHF3NjHHAA/9vWozDq/zn/rcVPizSoM='
WHERE
key_id = '12d7dbfa10808030c9a3508b0176cf1ab7bbe03a8f2ffce622b5ca76111e64fb'
AND (
token = '20uswUwgdEIeqHF3NjHHAA/9vWozDq/zn/rcVPizSoM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)