UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3X2tZbEiARGf0Z8DSfea5uVbDhLOm2HR/rHP5LXtZUk='
WHERE
key_id = '426286a532391558c59c0e681ab55a96fff5eb58b714b1259f27900b862d657c'
AND (
token = '3X2tZbEiARGf0Z8DSfea5uVbDhLOm2HR/rHP5LXtZUk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)