UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SoZiiM9dU/YJrhrNWXPU/ytjx+8pyRjoMtqI1EhZNa0='
WHERE
key_id = '32b7d23d2e9cfc4df7c741b5d553d72fc2b8663f9d14d531481571480b4ed1d1'
AND (
token = 'SoZiiM9dU/YJrhrNWXPU/ytjx+8pyRjoMtqI1EhZNa0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)