UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8WX5VVDbEaTv3e2hawDSukY/xX/8DybUqKyxuPQd2XE='
WHERE
key_id = 'fe5d6d673dacb92564717b01d8d73cc76e6842217ba3aa54a81e35e7c7e3057a'
AND (
token = '8WX5VVDbEaTv3e2hawDSukY/xX/8DybUqKyxuPQd2XE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)