UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TSuiP3TMS9ogCdBKktMS3h2AWq5EAuLKRv6BinbeCZs='
WHERE
key_id = '533934894a7f3af698162fdd661021e6f5d419feb6c1ecffdb58d1dfc34a653e'
AND (
token = 'TSuiP3TMS9ogCdBKktMS3h2AWq5EAuLKRv6BinbeCZs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)