UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LwgtOWYimE6Q7ayx5qszUJvYHEVaGO7h9Dp7U+7BYRw='
WHERE
key_id = 'b3e90e9fcf7f251dcc31341140a2b164a3d4906f7d8f53b520bc52b262616da6'
AND (
token = 'LwgtOWYimE6Q7ayx5qszUJvYHEVaGO7h9Dp7U+7BYRw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)