UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CgNyEVJ/9Yo04+gn+lVf5cvis5nzBAEDNmcE8f9js/o='
WHERE
key_id = '28840b97814fe3f096883031569f74c86219145bbd5553f7556df2b4b31cb349'
AND (
token = 'CgNyEVJ/9Yo04+gn+lVf5cvis5nzBAEDNmcE8f9js/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)