UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oKiSlVuVWT7BJd7dZUlHMrtgw65rvY06IKI3lFGFJ/c='
WHERE
key_id = 'b14914c3cedd834dda32e587b1719448b652490161ba9c60597d1dd464c26a1c'
AND (
token = 'oKiSlVuVWT7BJd7dZUlHMrtgw65rvY06IKI3lFGFJ/c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)