UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'odUMsnZ7sEfy3iGACpoY/WgFyjI65r+NO1UOiHroZLY='
WHERE
key_id = '1eb5a2f63a2d61ab840f4a584064e1bfb13b8f765af87df3648305f64a8dd90a'
AND (
token = 'odUMsnZ7sEfy3iGACpoY/WgFyjI65r+NO1UOiHroZLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)