UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IFbjLbEcOlZOrHQhm1vp1d8sqGgnaO+b+j5yVd6CZM0='
WHERE
key_id = '89fcb7c76c181d604874d012468514ab6b103b14a512d6fbd5ab9f0f6905762c'
AND (
token = 'IFbjLbEcOlZOrHQhm1vp1d8sqGgnaO+b+j5yVd6CZM0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)