UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/9LD5ZLozH4xc6GduukVhMXi098/bEDqcxFQGNLITdQ='
WHERE
key_id = 'c2aea03b5e0ca631654e557bcd6f5b5299d81c9a1cedd7e932a059db9b82d82a'
AND (
token = '/9LD5ZLozH4xc6GduukVhMXi098/bEDqcxFQGNLITdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)