UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n9vq+3ehN3dUhchoVvKAfn1NOkejm6h7+sojexjL58w='
WHERE
key_id = '9189aabd4be6d4ceca03e37e5dabe3ef6ecb87cfbaffb936e0c81539879af951'
AND (
token = 'n9vq+3ehN3dUhchoVvKAfn1NOkejm6h7+sojexjL58w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)