UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EHbpKw/BIILJ4PB+aFhWEoimmUypttGZ/eeQxjCuIpk='
WHERE
key_id = 'e7a5b39e578a4c99a45bba5b1fa530fe6fe9775fe391fa42b2b6038881e43e65'
AND (
token = 'EHbpKw/BIILJ4PB+aFhWEoimmUypttGZ/eeQxjCuIpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)