UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Ag6lMkArW7DXpnA2vlhZ26LOx6LXKKG+VbAOkTdf20='
WHERE
key_id = 'b4bea2fd785ce8abc54594f8fd84a25af62a3eaf028d107dceff705f88c11240'
AND (
token = '1Ag6lMkArW7DXpnA2vlhZ26LOx6LXKKG+VbAOkTdf20='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)